<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h3>具名插槽</h3>
      <child>
        <!-- <span>123</span>
        <span>456</span> -->

        <!-- left和right就是插槽的具体的名字 -->
        <template v-slot:left>
          <span>123</span>
        </template>
        <template v-slot:right>
          <span>456</span>
        </template>
        <!-- <span>789</span>
        <span>999</span> -->
        <template v-slot:default>
          <span>789</span>
          <span>999</span>
        </template>
      </child>
    </div>

    <script src="../../Vue.js"></script>
    <script>
      const Child = {
        template: `
          <div>
            <slot name="left"></slot>
            - child组件 - 
            <slot name="right"></slot>
            <slot></slot>
          </div>
        `,
      };

      new Vue({
        el: "#app",
        data: {},
        components: {
          Child,
        },
      });
    </script>
  </body>
</html>
